import json
import time
import datetime
import time
import requests
from common import sqlConnect
from common import beforeTest
from test_case import conftest

class getMall_info:

    def getMall_info(self):
        try:
            beforeT = beforeTest.beforeTest()
            self.fin_header = beforeT.e_login()
            user_id = beforeT.get_user_id()
            t = time.time()
            random_time = str(int(t))
            mall_url = 'http://erp.uat1.rscloud.com/api-zendai/user/v1/e/mall/getMallAuthoriHomePage?userId='+str(user_id)+'&randomTime='+random_time
            result = requests.get(url=mall_url, headers=conftest.fin_header)
            print(result.text)
            return json.loads(result.text)['data'][0]
        except BaseException:
            return False

# t_1 = getMall_info()
# a = t_1.getMall_info()
# print(type(a))
